#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

/************************************************************************/
/*                                                                      */
/************************************************************************/
#define SWAP(a, b) ((&(a) == &(b)) || \
                    (((a) -= (b)), ((b) += (a)), ((a) = (b) - (a))))
                    
#define SWAP2(a, b) ((&(a) == &(b)) || \
                    (((a) += (b)), ((b) = (a) - (b)), ((a) -= (b))))
                    
#define SWAP3(a, b) ((&(a) == &(b)) || \
                    (((a) = (b) - (a)), ((b) -= (a)), ((a) = (a) + (b))))

/************************************************************************/
/*                                                                      */
/************************************************************************/

int main(int argc, char* argv[])
{
    int x, y;
    
    x = 10;
    y = 20;
    
    printf("x = %d, y = %d\n", x, y);
    
    SWAP(x, y);
    
    printf("x = %d, y = %d\n", x, y);
    
    SWAP2(x, y);
    
    printf("x = %d, y = %d\n", x, y);
    
    SWAP3(x, y);
    
    printf("x = %d, y = %d\n", x, y);
    
    return 0;
}